import axios from '@/libs/api.request'
// import { getDomainId } from '@/libs/auth'
// const domainId = getDomainId()
/** addOrg(组织机构新增接口) */
export const addOrg = ({
  orgId,
  orgName,
  orgParentId,
  orgParentName,
  remarks
}) => {
  return axios.request({
    url: '/gas/domain/org/add',
    data: {
      orgId,
      orgName,
      orgParentId,
      orgParentName,
      remarks
    },
    method: 'post'
  })
}
/** updateOrg(组织机构修改接口
 * orgId 组织机构ID *
 * domainId 域ID *
 * orgName 组织机构名称 *
 * orgParentId 父机构ID
 * sort 序号
*/
export const updateOrg = ({
  orgId,
  // domainId,
  orgName,
  orgParentId,
  sort,
  remarks
}) => {
  return axios.request({
    url: '/gas/domain/org/update',
    data: {
      orgId,
      // domainId,
      orgName,
      orgParentId,
      sort,
      remarks
    },
    method: 'post'
  })
}
/** deleteOrg(删除组织机构) */
export const deleteOrg = (orgId) => {
  return axios.request({
    url: '/gas/domain/org/delete',
    data: {
      orgId
    },
    method: 'post'
  })
}
// listOrgPage(组织机构分页查询接口
export const listOrgPage = (orgForm) => {
  return axios.request({
    url: '/gas/domain/org/list',
    data: orgForm,
    method: 'post'
  })
}
// finOrgALlTree(组织机构树查询接口
export const finOrgALlTree = ({
  domainId,
  orgId
}) => {
  return axios.request({
    url: '/gas/domain/org/tree',
    data: {
      domainId,
      orgId
    },
    method: 'post'
  })
}
